<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="../mytags.jsp" %>
<t:base type="jquery"></t:base>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>巡检查询</title>
    <script type="text/javascript" charset="utf-8">
        mui.init();
        $(document).ready(function () {
            //alert($('#sn').val())
            if($('#sn').val()==null || $('#sn').val()==""){
                $('#nullSpan').hide()
            }
        })
    </script>
    <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?a2f6adcec5d52290d2cb3deea0aca05c";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
    <style>
        h4 span{
            margin-right: 20px !important;
        }
    </style>
</head>
<body style="padding-bottom:130px;">
<div class="tel"><a href="tel:400-88-22726"> <img style="height: 40%;width: 100%;" src="${webRoot }images/${logo}"></a>
</div>
<div class="mui-content" style="background: none; margin-top: 10px;  width: 100%;">
    <div style="padding: 10px 10px; background: #fff;">
        <div class="mui-content"
             style="width: 100%; background: #fff; padding: 15px; border-radius: 0;">
            <form id='login-form' class="mui-input-group" action="javascript:redirectQuery();">
                <div class="mui-input-row mui-input-row1" style="height: 40px; padding-left: 5px;">
                    <input type="text" class="mui-input" placeholder="请输入设备序列号查询" value="${sn}" name="sn" id="sn"
                           style="width: 80%;">
                    <label style="float: right; width: 50px; text-align: left; padding-top: 8px;">
                        <a href="javascript:redirectQuery();">
                            <img src="${webRoot }images/sach.png" style="width: 25px;"></a>
                    </label>
                </div>
            </form>
            <span style="color: #a6aaab;font-size: 11px">请在输入框中输入设备序列号，可查询设备本年度巡检时间安排</span>
        </div>
        <div class="mui-clearfix"></div>
    </div>
    <div id="item2" class="mui-control-content mui-active">
        <div class="mui-content" style="margin-top: 0px; width: 100%;">
            <div class="mui-content" style="width: 100%; margin-top: 0px; border-radius: 0; background: none;">
                <div class="mui-card" style="margin: 0; box-shadow: none; background: none;">
                    <ul class="mui-table-view hn">
                            <li style="padding:0px; border:none;">
                                <div id="dataDiv" class="mui-input-row mui-checkbox mui-left li_f mui-clearfix">
                                    <div class="inr" style="margin-left: 15px;">
                                        <div class="inrr" style=" margin: 10px 5px 10px 5px; width: 100%;text-align: center">
                                            <table style="margin-top: -20px">
                                                <tr>
                                                    <td style="width: 100px;text-align: right;color: #333333">序列号</td>
                                                    <td style="padding-left: 20px">${sn}</td>
                                                </tr>
                                                <tr>
                                                    <td style="width: 100px;text-align: right;color: #333333">巡检月份</td><c:if test="${not empty iplanList}">
                                                    <td style="padding-left: 20px">
                                                        <c:forEach items="${iplanList}" var="iplan">
                                                            <fmt:formatDate value="${iplan.ip_plan_date}" type="date" pattern="yyyy"></fmt:formatDate>年&nbsp;<fmt:formatDate value="${iplan.ip_plan_date}" type="date" pattern="MM"></fmt:formatDate>月&nbsp;
                                                        </c:forEach>
                                                    </td>
                                                </c:if>
                                                </tr>
                                                <tr>
                                                    <td style="width: 100px;text-align: right;color: #333333">巡检状态</td>
                                                    <td style="padding-left: 20px">
                                                        <c:if test="${not empty iplanList}">
                                                            <c:forEach items="${iplanList}" var="iplan">
                                                                <c:if test="${iplan.state=='j_inspection_complete'}">
                                                                    已完成
                                                                </c:if>
                                                                <c:if test="${iplan.state!='j_inspection_complete'}">
                                                                    计划中
                                                                </c:if>
                                                            </c:forEach>
                                                        </c:if>
                                                    </td>
                                                </tr><br>
                                            </table>

                                            <span id="nullSpan" style="height:40px;color:#a6aaab;text-align: center">
                                                <c:if test="${empty iplanList}">
                                                        <br>没有找到该设备的巡检信息，如有疑问，请拨打<br>中影巴可客服电话<a style="color:blue;" href="tel:400-88-22726">400-88-22726</a>进行咨询。
                                                </c:if>
                                            </span>
                                            <%--<div style="position:fixed;bottom:60px;left:0px;right:0px; width:100%; text-align: center;height:38px;">--%>
                                                <%--<a class="mui-btn mui-btn-block mui-btn-primary" style="padding: 5px 0;width:40%;float:left;left:20px;color:#fff;" onclick="goXjyy()">巡检预约</a>--%>
                                                <%--<a class="mui-btn mui-btn-block mui-btn-primary" style="padding: 5px 0;width:40%;float:right;right:20px;color:#fff;" onclick="goXjbg()">巡检变更</a>--%>
                                            <%--</div>--%>
                                        </div>
                                    </div>
                                </div>
                            </li>
                    </ul>
                </div>
            </div>
        </div>

    </div>
    <div style="text-align: center;margin-top:15px;"><a style="color:blue; display: inline-block; font-size: 14px" href="wxMenuController.do?xjjs">点击查看巡检内容介绍&nbsp;<span style="margin-top:2px;font-size:17px; float:right;">︾</span></a></div>
    <c:if test="${empty iplanList}">
        <div id="butDiv" style="bottom:60px;left:0px;right:0px; width:100%; text-align: center;height:38px;margin-top: 15px" hidden="hidden">
            <a class="mui-btn mui-btn-block mui-btn-primary"  style="padding: 5px 0;width:40%;float:left;left:20px;color:#fff;" onclick="goXjyy()">巡检预约</a>
            <a class="mui-btn mui-btn-block mui-btn-primary"  style="padding: 5px 0;width:40%;float:right;right:20px;color:#fff;" onclick="goXjbg()">巡检变更</a>
        </div>
    </c:if>
    <c:if test="${not empty iplanList}">
        <div id="butDiv" style="bottom:60px;left:0px;right:0px; width:100%; text-align: center;height:38px;margin-top: 15px">
            <a class="mui-btn mui-btn-block mui-btn-primary"  style="padding: 5px 0;width:40%;float:left;left:20px;color:#fff;" onclick="goXjyy()">巡检预约</a>
            <a class="mui-btn mui-btn-block mui-btn-primary"  style="padding: 5px 0;width:40%;float:right;right:20px;color:#fff;" onclick="goXjbg()">巡检变更</a>
        </div>
    </c:if>

</div>

<div class="fot" style="position: fixed;bottom: 0px; left:0px; right:0px;line-height:20px;padding:5px 5px 5px 5px;">
    如需更多服务请拨打中影巴可24小时服务热线<br/><a href="tel:400-88-22726" style="color:blue">400-88-22726</a>咨询
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#xb').click(function () {
            $('.mui-backdrop.ppp').toggle();
        })
        $('.close').click(function () {
            $('.mui-backdrop').toggle();
        })
    });
    function redirectQuery() {
        window.location.href = "CbsWxInspectionController.do?goWxInspectionList&sn=" + $('#sn').val();
    }

    function goXjyy() {
        window.location.href = "wxMenuController.do?xjyy&sn=" + $('#sn').val();
    }
    function goXjbg() {
        window.location.href = "wxMenuController.do?xjbg&sn=" + $('#sn').val();
    }
</script>
</body>
</html>